package com.jf.cloud.multishop.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.multishop.dto.ShopMsgUserDTO;
import com.jf.cloud.multishop.model.ShopMsgUser;
import com.jf.cloud.multishop.mapper.ShopMsgUserMapper;
import com.jf.cloud.multishop.service.ShopMsgUserService;
import com.jf.cloud.multishop.vo.ShopMsgUserVO;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 
 *
 * @author zz
 * @date 2023-03-26 15:42:57
 */
@Service
public class ShopMsgUserServiceImpl implements ShopMsgUserService {

    @Autowired
    private ShopMsgUserMapper shopMsgUserMapper;

    @Override
    public PageVO<ShopMsgUser> page(PageDTO pageDTO, ShopMsgUserDTO shopMsgUserDTO) {
        return PageUtil.doPage(pageDTO, () -> shopMsgUserMapper.list(shopMsgUserDTO));
    }

    @Override
    public ShopMsgUser getById(Long id) {
        return shopMsgUserMapper.getById(id);
    }

    @Override
    public ShopMsgUser getByOpenId(String openId,Long shopId) {
        return shopMsgUserMapper.getByOpenId(openId,shopId);
    }

    @Override
    public void save(ShopMsgUser shopMsgUser) {
        shopMsgUserMapper.save(shopMsgUser);
    }

    @Override
    public void update(ShopMsgUser shopMsgUser) {
        shopMsgUserMapper.update(shopMsgUser);
    }

    @Override
    public void deleteById(Long id) {
        shopMsgUserMapper.deleteById(id);
    }

    @Override
    public List<String> listByShopId(Long shopId) {
        return shopMsgUserMapper.listOpenIdByShopId(shopId);
    }
}
